package com.qishon.pc.domain.util;

import com.qishon.pc.domain.Application.ProgressControlManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

@Component
public class ScheduledTasks {

    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
    @Autowired
    ProgressControlManager progressControlManager;
    @Scheduled(fixedRate = 60000)
    public void reportCurrentTime() {
        System.out.println("当前时间：" + dateFormat.format(new Date()));
        progressControlManager.startRendering();
    }

}
